package com.zhentao.controller;

import com.zhentao.domain.vo.Result;
import com.zhentao.service.SysUserSiteService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @ClassName: SysUserSiteController
 * @Desrciption: Mr.chengfenzhan
 * @Author: 知安_程烽展
 * @Date: 2024/9/1 18:59
 */







@RestController
@RequestMapping("/sysusersite")
@Tag(name = "用户站点管理")
public class SysUserSiteController {
    @Autowired
    private SysUserSiteService sysUserSiteService;
    @GetMapping("/getUserList")
    @Operation(summary = "获取用户站点列表")
    public Result getUserList()
    {
        return sysUserSiteService.getUserList();
    }
    @DeleteMapping("/delData/{id}")
    @Operation(summary = "删除用户站点")
    public Result delData(@PathVariable("id") Integer id)
    {
        return sysUserSiteService.removeById(id)?Result.build(null,200,"删除成功"):Result.build(null,400,"删除失败");
    }
    @PostMapping("/collectsite")
    @Operation(summary = "收藏站点")
    public Result collectSite(Integer sid) {
        return sysUserSiteService.collectSite(sid);
    }
}
